package tma.sdcbatch11.foodordering;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class IsAdapter extends ArrayAdapter<ItemKindOfDish>{
	private LayoutInflater inflater;
		
	public IsAdapter(Context context, ItemKindOfDish[] list) {
			super(context, 0, list);
			inflater = LayoutInflater.from(context);
	}

	@SuppressLint("InflateParams")
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if(convertView == null){
			convertView = inflater.inflate(R.layout.item_store, null);
				
		}
			
		TextView txtName =(TextView) convertView.findViewById(R.id.txt_name);
		TextView txtRate = (TextView) convertView.findViewById(R.id.txt_rate);
		TextView txtAddress = (TextView ) convertView.findViewById(R.id.txt_address);
			
		ItemKindOfDish item = getItem(position);
		txtName.setText(item.name);
		txtRate.setText(item.rate);
		txtAddress.setText(item.address);
			
		return convertView;
	}
		
		
}
